{% extends 'page_pupil.html' %}

{% block sort_headers %}{1: {sorter: false}}{% endblock %}

{% block padding %}
	<h1>{{ subject }}</h1> 
	{#<div class="classroom"><div><div>23</div></div></div>#}
	<div class="calendar">{{ subject.days|join:", " }}</div>
	<div class="teacher"><a href="/teachers/{{ subject.teacher.id }}">{{ subject.teacher.fio }}</a></div>
{% endblock %}

{% block content %}
	<table class="table sort">
	  <thead>
	  <tr>
	    <th class="ajax_link"><span>Дата</span></th>
	    <th>Тема</th>
	    <th class="ajax_link"><span>Оценка</span></th>
      <th>Домашнее задание</th>
      <th></th>
	  </tr>
	  </thead>
	  
	  <tbody>
	  	{% for lesson in lessons %}
  		  <tr class="{% cycle 'gray' '' %}">
  		    <td><div class="date">{{ lesson.date|date:"d.m" }}</div></td>
  		    <td>{{ lesson.topic }}</td>
  		    <td><div class="mark-{{ lesson.mark.get_type }}"><span title="{{ lesson.mark.comment }}">{{ lesson.mark }}</span></div></td>
          <td>{{ lesson.task }}</td>
          <td>
            {% if lesson.file %}
              <a href="{{ MEDIA_URL }}{{ lesson.file }}">Скачать файл</a>
            {% endif %}
          </td>
  		  </tr>
		{% endfor %}
	  
	  </tbody>
	  
	  <tfoot>
	  <tr>
	    <td></td>
	    <td><div class="date">Средний балл</div></td>
	    <td><div class="mark-{{ subject.avg_type }}">{{ subject.avg|default:0|floatformat:"-2" }}</div></td>
	    <td></td>
	  </tr>
	  </tfoot>
	</table>
{% endblock %}